#include "FramedSource.hh"
#include "UsageEnvironment.hh"

#define JPEG_HEADER_MAX_SIZE 623

class CameraMPEG4ESVideoSource :
	public FramedSource
{
public:
	static CameraMPEG4ESVideoSource* createNew(UsageEnvironment& env, char* url);
	Boolean isMPEG4VideoStreamFramer();
	bool isFull;

public:
    virtual u_int8_t type();
    virtual u_int8_t width(); // # pixels/8 (or 0 for 2048 pixels)
    virtual u_int8_t height(); // # pixels/8 (or 0 for 2048 pixels)

protected:
	CameraMPEG4ESVideoSource(UsageEnvironment& env, char* url);
	~CameraMPEG4ESVideoSource(void);

	char* rtspURL;

private:
    // redefined virtual functions:
    virtual void doGetNextFrame();
    virtual void doStopGettingFrames();

private:
	u_int8_t fLastWidth;
	u_int8_t fLastHeight;
};
